package NewTmas.FramesandPanels;

import taskmaster.auth.LoginTools;

import javax.swing.*;
import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: jhauser
 * Date: Jul 8, 2011
 * Time: 6:18:14 PM
 * To change this template use File | Settings | File Templates.
 */
public class LoginOpsMode extends LoginTools
{
    public static void main(final String[] args)
    {
        final String userName;
        final String password;
        final String db;
        if (args.length >= 3)
        {
            userName = args[0];
            password = args[1];
            db = args[2];
        } else if (args.length >= 2)
        {
            userName = args[0];
            password = args[1];
            db = null;
        } else if (args.length == 1)
        {
            userName = args[0];
            password = null;
            db = null;
        }
        else
        {
            userName = null;
            password = null;
            db = null;
        }
        printClassLoaderAndEnv();

        try
        {
            EventQueue.invokeLater(new Runnable()
            {
                public void run()
                {
                    LoginFrame window = new LoginFrame(userName, password, db);
                }
            });
        } catch (Exception e)
        {
            JOptionPane.showMessageDialog(null, "Problem logging in : " + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
            e.printStackTrace();
        }
    }
}
